import React from 'react'
import styles from './index.module.less'

import Radar from '@/pages/job/components/Radar'

export default function WorkTest({ data }: any) {
    console.log(data)
    return (
        <div className={styles.container}>
            <div className={styles.wrapper}>
                <div className={styles.title}>{data.name}</div>
                <div className={styles.radar_wrapper}>
                    {data?.detail?.map((item: any) => {
                        const { userEvalPaperResult } = item
                        const radarList = userEvalPaperResult.map((result: any) => {
                            const { question_id, score, evalQuestion } = result
                            const { evalConfigQuestion } = evalQuestion

                            return {
                                score,
                                name: evalConfigQuestion?.config?.name,
                                question_id,
                            }
                        })
                        return (
                            <div className={styles.radar_box} key={item}>
                                <div className={styles.radar_title}>{item?.testEval?.name}</div>
                                <Radar data={radarList} />
                            </div>
                        )
                    })}
                </div>
            </div>
        </div>
    )
}
